@extends("layout/admin")
@section("css")
    <style type="text/css">
        .img img{background: #fff; width: 100%;}
    </style>
@endsection
@section("content")
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>订单管理</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="/admin">后台管理</a>
                </li>

                <li class="active">
                    <strong>订单详情</strong>
                </li>
            </ol>
        </div>
        <div class="col-lg-2">

        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        {{--<h5>All form elements <small>With custom checbox and radion elements.</small></h5>--}}
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a href="form_basic.html#">Config option 1</a>
                                </li>
                                <li><a href="form_basic.html#">Config option 2</a>
                                </li>
                            </ul>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form method="post" action="/admin/goods-updateRes" class="form-horizontal" enctype="multipart/form-data">
                            <div class="form-group"><label class="col-sm-2 control-label">用户</label>

                                <div class="col-sm-10"><input name="name" value="{{$ordersInfo->user->username}}" type="text" class="form-control"></div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group"><label class="col-sm-2 control-label">桌号</label>

                                <div class="col-sm-10"><input name="num" value="{{$ordersInfo->number}}" type="text" class="form-control"></div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group"><label class="col-sm-2 control-label">订单号</label>

                                <div class="col-sm-10"><input name="reprice" value="{{$ordersInfo->orders_num}}" type="text" class="form-control"></div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group"><label class="col-sm-2 control-label">实付款</label>
                                <div class="col-sm-10"><input name="price" value="{{$ordersInfo->real_price}}" type="text" class="form-control"></div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group"><label class="col-sm-2 control-label">订单状态</label>

                                <div class="col-sm-10"><input name="integral" value="@if($ordersInfo['status']==0) 待付款 @elseif($ordersInfo['status']==1) 待评价 @elseif($ordersInfo['status']==2) 已完成 @endif" type="text" class="form-control"></div>
                            </div>
                            <div class="hr-line-dashed"></div>

                            <div class="form-group"><label class="col-sm-2 control-label">订单详情</label>
                                <div class="wrapper wrapper-content animated fadeInRight">
                                    <div class="row">
                                        <div class="col-lg-6">
                                            <div class="ibox float-e-margins">
                                                <div class="ibox-title">
                                                    <h5>订单详情</h5>
                                                    <div class="ibox-tools">
                                                        <a class="collapse-link">
                                                            <i class="fa fa-chevron-up"></i>
                                                        </a>
                                                        <a class="dropdown-toggle" data-toggle="dropdown" href="table_basic.html#">
                                                            <i class="fa fa-wrench"></i>
                                                        </a>
                                                        <ul class="dropdown-menu dropdown-user">
                                                            <li><a href="table_basic.html#">Config option 1</a>
                                                            </li>
                                                            <li><a href="table_basic.html#">Config option 2</a>
                                                            </li>
                                                        </ul>
                                                        <a class="close-link">
                                                            <i class="fa fa-times"></i>
                                                        </a>
                                                    </div>
                                                </div>
                                                <div class="ibox-content">

                                                    <table class="table">
                                                        <thead>
                                                        <tr>
                                                            <th>#</th>
                                                            <th>商品名</th>
                                                            <th>价格</th>
                                                            <th>数量</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody>
                                                        @foreach($ordersInfo->ordersInfo()->get() as $k=>$v)
                                                            <tr>
                                                                <td>{{$k+1}}</td>
                                                                <td>{{$v->goods->name}}</td>
                                                                <td>{{$v->goods->price}}</td>
                                                                <td>{{$v['num']}}</td>
                                                            </tr>
                                                        @endforeach
                                                        </tbody>
                                                    </table>

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button onclick="javascript:history.back(-1);" class="btn btn-primary" type="button">返回</button>
                                </div>
                            </div>
                            {{csrf_field()}}
                        </form>
                    </div>
                </div>
            </div>
        </div>
        @endsection
        @section("js")

        <script>
            $(document).ready(function(){
                $('.i-checks').iCheck({
                    checkboxClass: 'icheckbox_square-green',
                    radioClass: 'iradio_square-green',
                });
            });
        </script>
@endsection